home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / pxfstructcopy.z / pxfstructcopy
Encoding:
Text File  |  2002-10-03  |  4.5 KB  |  103 lines

  1. PXFSTRUCTCOPY(3F)                                     Last changed: 1-22-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFSSTTRRUUCCTTCCOOPPYY - Copies structure
  6.  
  7. SSYYNNOOPPSSIISS
  8.      SSUUBBRROOUUTTIINNEE PPXXFFSSTTRRUUCCTTCCOOPPYY ((_s_t_r_u_c_t_n_a_m_e,, _j_h_a_n_d_l_e_1,, _j_h_a_n_d_l_e_2,, _i_e_r_r_o_r))
  9.      IINNTTEEGGEERR _j_h_a_n_d_l_e_1,, _j_h_a_n_d_l_e_2,, _i_e_r_r_o_r
  10.      CCHHAARRAACCTTEERR*_n _s_t_r_u_c_t_n_a_m_e
  11.  
  12. IIMMPPLLEEMMEENNTTAATTIIOONN
  13.      UNICOS, UNICOS/mk, and IRIX systems
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      IEEE standard interface for FORTRAN 77
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  20.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  21.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  22.      F77 compiler.
  23.  
  24.      The PPXXFFSSTTRRUUCCTTCCOOPPYY routine copies structures created with
  25.      PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F). The structure referenced by _j_h_a_n_d_l_e_1 is copied to
  26.      the structure referenced by _j_h_a_n_d_l_e_2.
  27.  
  28.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  29.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  30.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  31.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  32.      IRIX, the default kind is KKIINNDD==44.
  33.  
  34.      The following are valid arguments for this routine:
  35.  
  36.      _s_t_r_u_c_t_n_a_m_e
  37.                An input character variable or array element containing the
  38.                structure name corresponding to the two structure handles'
  39.                type.
  40.  
  41.      _j_h_a_n_d_l_e_1  An input structure handle variable to be copied.
  42.  
  43.      _j_h_a_n_d_l_e_2  An output structure handle variable that will contain a copy
  44.                of the structure of _j_h_a_n_d_l_e_1 after successful execution of
  45.                PPXXFFSSTTRRUUCCTTCCOOPPYY.
  46.  
  47.      _i_e_r_r_o_r    An output integer variable that contains zero if
  48.                PPXXFFSSTTRRUUCCTTCCOOPPYY was successful or nonzero if PPXXFFSSTTRRUUCCTTCCOOPPYY was
  49.                not successful.
  50.  
  51.      This routine may also return any of the following error values:
  52.  
  53.      EENNOONNAAMMEE      If _s_t_r_u_c_t_n_a_m_e is an invalid structure name, or if
  54.                   _s_t_r_u_c_t_n_a_m_e does not match the _j_h_a_n_d_l_e_1 and _j_h_a_n_d_l_e_2
  55.                   structure type.
  56.  
  57.      EENNOOMMEEMM       If memory is unavailable to create data structures needed
  58.                   to copy a component.
  59.  
  60.      EEBBAADDHHAANNDDLLEE   If _j_h_a_n_d_l_e_1 or _j_h_a_n_d_l_e_2 is an invalid handle or has an
  61.                   incorrect handle type (UNICOS and UNICOS/mk only).
  62.  
  63. EEXXAAMMPPLLEESS
  64.      In this example, two uuttssnnaammee structures are created using
  65.      PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F). PPXXFFUUNNAAMMEE(3F) is called with one uuttssnnaammee
  66.      structure, which is then copied to the other uuttssnnaammee structure.
  67.  
  68.  program pxftest
  69.  integer jhandle1, jhandle2
  70.  integer ierror
  71.  
  72.  CALL PXFSTRUCTCREATE('utsname',jhandle1,ierror)
  73.  if (ierror .ne. 0) then
  74.     print *,' FAILED: PXFSTRUCTCREATE for utsname1'
  75.  else
  76.     CALL PXFSTRUCTCREATE('utsname',jhandle2,ierror)
  77.     if (ierror .ne. 0) then
  78.        print *,' FAILED: PXFSTRUCTCREATE for utsname2 with error = ',ierror
  79.     else
  80.        CALL PXFUNAME(jhandle1,ierror)
  81.        if (ierror .ne. 0) then
  82.           print *,' FAILED: PXFUNAME for utsname1 with error = ',ierror
  83.        else
  84.           CALL PXFSTRUCTCOPY('utsname',jhandle1,jhandle2,ierror)
  85.           if (ierror .ne. 0) then
  86.              print *,' FAILED: PXFSTRUCTCOPY with error = ', ierror
  87.           else
  88.              print *,' PASSED: PXFSTRUCTCOPY test for utsname struct'
  89.           endif
  90.        endif
  91.     endif
  92.  endif
  93.  
  94.  CALL PXFSTRUCTFREE(jhandle1,ierror)
  95.  CALL PXFSTRUCTFREE(jhandle2,ierror)
  96.  end
  97.  
  98. SSEEEE AALLSSOO
  99.      PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F), PPXXFFUUNNAAMMEE(3F)
  100.  
  101.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
  102.      version of this man page.
  103.